//
//  EpointViewTestPersonChooseController.m
//  EpointFrame5
//
//  Created by 李亚春 on 13-12-18.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "EpointViewTestPersonChooseController.h"
#import "EpointPersonChooseViewController.h"
#import "UIViewController+MJPopupViewController.h"

@interface EpointViewTestPersonChooseController ()
{
    NSString *sjrGuids;
    NSString *csrGuids;
}
@end

@implementation EpointViewTestPersonChooseController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        sjrGuids = @"";
        csrGuids = @"";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"人员选择示例";
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)sjrAction:(id)sender {
    [EpointPersonChooseViewController pushChoosePerson:self WithTag:@"sjr" AndNames:tfSjr.text AndGuids:sjrGuids];
}

-(void)epointPerson:(NSString *)controlTag chooseData:(NSMutableArray *)data
{
    NSArray *arr =[EpointPersonChooseViewController getChoosedArray:data];
    if ([controlTag isEqualToString:@"sjr"]) {
        tfSjr.text = [arr objectAtIndex:0];
        sjrGuids = [arr objectAtIndex:1];
    }
    else if ([controlTag isEqualToString:@"csr"])
    {
        tfCsr.text = [arr objectAtIndex:0];
        csrGuids = [arr objectAtIndex:1];
    }
}

- (IBAction)csrAction:(id)sender {
    [EpointPersonChooseViewController pushChoosePerson:self WithTag:@"csr" AndNames:tfCsr.text AndGuids:csrGuids];
}

@end
